import { GxUser } from "@/typings/GxUser";
import { IRegister } from "@/typings/IRegister";
import axiosFn from "@/utils/request";

const userService={
    /**
     * 用户登录
     * @param loginUser 登录用户业务模型
     * @returns 异步响应结果
     */
    login:(loginUser:GxUser)=>{
        return new Promise((resolve,reject)=>{
            axiosFn.commonOnPost("/user/login",loginUser)
            .then(res=>{
                resolve(res);
            })
           }) 
    },
    /**
     * 用户注册
     * @param registUser 注册用户业务模型
     * @returns 异步响应结果
     */
    regist:(registUser:IRegister)=>{
       return new Promise((resolve,reject)=>{
        axiosFn.commonOnPost("/user/regist",registUser)
        .then(res=>{
            resolve(res);
        })
       }) 
    },
}
export default userService;